<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Jedrzej\Pimpable\PimpableTrait;

class Diy extends Model
{
    use HasFactory;
    use PimpableTrait;
    use SoftDeletes;

    /**
     * 默认排序
     */
    protected $defaultSortCriteria = ['id,desc'];

    /**
     * 可排序字段
     */
    public $sortable = [
        'version',
        'name',
        'template_name',
        'work_id',
        'type',
        'created_at'
    ];

    /**
     * 可搜索字段
     */
    public $searchable = [
        'version',
        'name',
        'template_name',
        'work_id',
        'type',
        'created_at'
    ];
    /**
     * 可批量复制字段
     */
    protected $fillable = [
        'version',
        'name',
        'template_name',
        'default_value',
        'value',
        'add_time',
        'update_time',
        'status',
        'type',
    ];
}
